var __extends =
    (this && this.__extends) ||
    (function () {
      var t = function (o, e) {
        return (t =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (t, o) {
              t.__proto__ = o;
            }) ||
          function (t, o) {
            for (var e in o)
              Object.prototype.hasOwnProperty.call(o, e) && (t[e] = o[e]);
          })(o, e);
      };
      return function (o, e) {
        function i() {
          this.constructor = o;
        }
        if ("function" != typeof e && null !== e)
          throw new TypeError(
            "Class extends value " + String(e) + " is not a constructor or null"
          );
        t(o, e),
          (o.prototype =
            null === e
              ? Object.create(e)
              : ((i.prototype = e.prototype), new i()));
      };
    })(),
  LookSkillDialog = (function (t) {
    function o() {
      var o = t.call(this) || this;
      return (
        WebSocketService.addListener({
          caller: o,
          code: 2051,
          method: o.onLoadSkillShuoMingData,
        }),
        WebSocketService.addListener({
          caller: o,
          code: 1034,
          method: o.onLoadSkillShuoMingData,
        }),
        o.btn_xuexijineng.on(Laya.Event.CLICK, o, o.onDidXueXiJiNengAction),
        o
      );
    }
    return (
      __extends(o, t),
      (o.showLookSkillDialog = function (t, e) {
        null == this.lookV &&
          ((this.lookV = new o()), (this.lookV.zOrder = 1e3)),
          (this.lookV.objJson = t),
          "AXSuboardinateDetailView" == e
            ? (this.lookV.initUI(),
              t.id
                ? ((this.lookV.btn_xuexijineng.label = "重修技能"),
                  WebSocketService.send({
                    c: 1034,
                    d: { cid: t.cid, sid: t.id },
                  }),
                  (this.lookV.action_skill = "5"),
                  (this.lookV.action_type = "chongxiu"))
                : ((this.lookV.btn_xuexijineng.label = "学习技能"),
                  (this.lookV.action_skill = "3"),
                  (this.lookV.action_type = "xuexi")),
              (this.lookV.btn_xuexijineng.visible = !0))
            : (WebSocketService.send({ c: 2051, d: { id: t.id } }),
              (this.lookV.btn_xuexijineng.visible = !1)),
          this.lookV.popup(!0);
      }),
      (o.prototype.initUI = function () {
        (this.label_lookSkill_title.text = ""),
          (this.label_look_lvl.text = ""),
          (this.label_look_miaoshu.text = ""),
          (this.label_look_effect.text = ""),
          (this.label_look_haojing.text = ""),
          (this.action_skill = ""),
          (this.action_type = "");
      }),
      (o.prototype.onLoadSkillShuoMingData = function (t) {
        if (0 == t.code) {
          var o = t.data;
          this.label_lookSkill_title.text = o.name;
          var e = 0 == o.grade ? "未学习" : this.dealGradeOrHuaString(o);
          (this.label_look_lvl.text = e),
            (this.label_look_miaoshu.text = o.descr),
            (this.label_look_effect.text = "造成" + o.value + "伤害"),
            (this.label_look_haojing.text = "消耗" + o.mp + "精力");
        } else ToastView.toastView(t.msg), this.close();
      }),
      (o.prototype.dealGradeOrHuaString = function (t) {
        return t.hua >= 1
          ? "化境Lv" + t.grade + "(" + t.useCount + "熟)"
          : t.grade + "级(" + t.useCount + "熟)";
      }),
      (o.prototype.onDidXueXiJiNengAction = function () {
        AXStudySkillDialog.showStudySkillView(this.objJson, this.action_type);
      }),
      (o.prototype.checkFuJiangHaveZhuanZhi = function () {
        return this.objJson.roleType > 10 && this.objJson.roleType < 100
          ? "1"
          : this.objJson.roleType > 100
          ? "2"
          : "0";
      }),
      (o.prototype.onLoadSkillStudyData = function (t) {
        ToastView.toastView(t.data),
          0 == t.code &&
            WebSocketService.send({ c: 1009, d: { id: this.objJson.cid } }),
          this.close();
      }),
      o
    );
  })(ui.UserInfoController.LookSkillDialogUI);
